home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HyperLib 1997 Winter - Disc 1
/
HYPERLIB-1997-Winter-CD1.ISO.7z
/
HYPERLIB-1997-Winter-CD1.ISO
/
オンラインウェア
/
UTIL
/
Alpha 6.5.sit
/
Tcl
/
SystemCode
/
browser.tcl
< prev
next >
Wrap
Text File
|
1996-08-15
|
1KB
|
52 lines
#=============================================================================
# Browser mode.
#=============================================================================
proc dummyBrws {} {}
proc upBrowse {} {
set limit [nextLineStart [nextLineStart 0]]
if {[getPos] > $limit} {
set limit [expr [getPos] - 1]
}
select [lineStart $limit] [nextLineStart $limit]
}
proc downBrowse {} {
set pos [getPos]
if {$pos < [nextLineStart 0]} {
set pos [nextLineStart 0]
}
if {[nextLineStart $pos] != [maxPos]} {
select [nextLineStart $pos] [nextLineStart [nextLineStart $pos]]
}
}
proc nextMatch {{wname "*Batch Find*"}} {
set wins [winNames]
set res [lsearch $wins $wname]
if {$res < 0} {
set res [lsearch -regexp $wins {¥*.*¥*}]
if {$res < 0} return
}
set win [lindex $wins $res]
bringToFront $win
downBrowse
gotoMatch
dispErr $win
}
bind '¥r' gotoMatch Brws
bind enter gotoMatch Brws
ascii 0x3 gotoMatch Brws
bind down downBrowse Brws
bind up upBrowse Brws
bind 'n' <z> downBrowse Brws
bind 'p' <z> upBrowse Brws
ascii 0x20 downBrowse Brws
ascii 0x8 upBrowse Brws